/*
 * maz_mod_led.h
 *
 *  Created on: Jun 7, 2020
 *      Author: Paul
 */

#ifndef INC_MAZ_MOD_LED_H_
#define INC_MAZ_MOD_LED_H_

#include "maz_com.h"
#include "maz_drv.h"
#include "maz_mod.h"

typedef enum _MAZMOD_E_LED_POLAR_
{
    MAZMOD_E_LED_POLAR_LOW  = GPIO_PIN_RESET,
    MAZMOD_E_LED_POLAR_HIGH = GPIO_PIN_SET,
} MAZMOD_E_LED_POLAR;

typedef enum _MAZMOD_E_LED_STATUS_
{
    MAZMOD_E_LED_STATUS_OFF = 0,
    MAZMOD_E_LED_STATUS_ON,
    MAZMOD_E_LED_STATUS_TOGGLE,
} MAZMOD_E_LED_STATUS;

typedef struct _MAZMOD_LED_CFG_
{
    MAZDRV_GPIO_CTRL        gpio;
    MAZMOD_E_LED_POLAR      polar;              // 高电平还是低电平点亮
    MAZMOD_E_LED_STATUS     status;             // 默认状态是点亮还是熄灭
} MAZMOD_LED_CFG;

typedef struct _MAZMOD_LED_CTRL_
{
    MAZMOD_LED_CFG          cfg;
} MAZMOD_LED_CTRL;

int MAZ_Mod_led_init(MAZMOD_LED_CTRL *pctrl);
int MAZ_Mod_led_status_set(MAZMOD_LED_CTRL *pctrl, MAZMOD_E_LED_STATUS status);

#endif /* INC_MAZ_MOD_LED_H_ */
